from django.db import models


class RunResult(models.Model):
    object: models.QuerySet

    class RunStatus(models.IntegerChoices):
        INIT = 0,"初始化"
        Ready = 1,"准备开始"
        Running = 2,"正在执行"
        Reporting = 3,"正在生成报告"
        Done = 4,"执行完毕"
        Error = -1,"执行出错"

    path = models.CharField("用例路径",max_length=255)
    is_pass = models.BooleanField("测试通过",default=False)
    status = models.IntegerField("执行状态",choices=RunStatus.choices,default=RunStatus.INIT)

    creat_datetime = models.DateTimeField("创建时间",auto_now_add=True)
    update_datetime = models.DateTimeField("更新时间",auto_now=True)